# Build and development tools for world-gen library

GO := go
GOFMT := gofmt
GOLINT := golangci-lint

.PHONY: all build test lint fmt clean

all: build test lint

build:
	@echo "Building library..."
	$(GO) build ./...

test:
	@echo "Running tests..."
	$(GO) test ./internal/... -v

lint:
	@echo "Linting code..."
	@if command -v $(GOLINT) >/dev/null; then \
		$(GOLINT) run; \
	else \
		echo "golangci-lint not installed, skipping"; \
	fi

fmt:
	@echo "Formatting code..."
	$(GOFMT) -w .

examples:
	@echo "Building examples..."
	@cd example/basic && $(GO) build
	@cd example/similarity && $(GO) build
	@cd example/difficulty && $(GO) build

clean:
	@echo "Cleaning up..."
	$(GO) clean
	@rm -f example/*/*.exe example/*/*.bin